package com.zzy.librarytest.dao;

import com.zzy.librarytest.entity.User;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface UserDao {
    @Select("select id from t_user where username=#{username} and password=#{password}")
    Integer selectUser(String username , String password);

    @Select("select * from t_user where username=#{username}")
    User selectOneUser(String username);

    @Select("select * from t_user")
    List<User> selectAllUser();

    @Insert("insert into t_user(username,password) values(#{username},#{password})")
    Integer insertUser(String username , String password);

    @Delete("delete from t_user where username=#{username}")
    Integer deleteUser(String username);

    @Update("update t_user set password=#{password} where username=#{username}")
    Integer updateUser(String username , String password);

}
